//
// Created by neo on 2025/2/9.
//

#ifndef GLFWWINDOW_H
#define GLFWWINDOW_H

#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <vector>

#include "../../event/IEventHandler.h"
#include "../../window/IWindow.h"

class GLFWWindowImpl final : public IWindow {
  GLFWwindow *window = nullptr;
  bool glfwInitialized = false;

public:
  explicit GLFWWindowImpl(IEventHandler *handler);

  void CreateWindow(uint32_t posX, uint32_t posY, uint32_t width,
                    uint32_t height, const char *title) override;

  void CreateWindow(uint32_t posX, uint32_t posY, uint32_t width,
                    uint32_t height, const char *title, uint32_t mode) override;

  ~GLFWWindowImpl() override;

  bool ShouldClose() override;

  void PollEvent() override;

  void Render() override;

  std::vector<const char *> GetRendererRequiredExtensions() override;

  Surface GetSurface(SurfaceGetParams params) override;
};

#endif // GLFWWINDOW_H
